/*
 * Created on 2005-6-29
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.linkage.lcims.base.memoryparam;

import com.linkage.lcims.base.memoryparam.interfaces.*;
import com.linkage.lcims.base.memoryparam.impl.*;
import com.linkage.util.exception.MPException;
/**
 * @author Administrator
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class ParamUtil {
	public static final int MONEY_CONVERSION = 100;
	public static final int STATUS_NORMAL = 0;
	public static final int STATUS_PAUSE = 1;
	public static final int STATUS_CANCEL = 2;

	private static AreaMP areaMP = AreaMPImpl.getInstance();
	private static PaytypeMP paytypeMP = PaytypeMPImpl.getInstance();
	private static SysConfigMP sysConfigMP = SysConfigMPImpl.getInstance();
	private static ServiceTypeMP serviceTypeMP = ServiceTypeMPImpl.getInstance();
	
	public static int getCloseDay() throws Exception{
		try{
			String closeDay = sysConfigMP.getValue("CLOSEDAY");
			if(closeDay != null && !closeDay.equals(""))
				return Integer.parseInt(closeDay);
		}catch (Exception e) {
			throw new MPException(e, "com.linkage.lcims.base.memoryparam.ParamUtil");
		}
		return 21;
	}
	
	public static String getAreaName(String areano) throws Exception{
		try{
			return areaMP.getAreaName(areano);
		}catch (Exception e) {
			throw new MPException(e, "com.linkage.lcims.base.memoryparam.ParamUtil");
		}
	}
	
	public static String getPaytypeName(String paytype) throws Exception{
		try{
			return paytypeMP.getDesc(paytype);
		}catch (Exception e) {
			throw new MPException(e, "com.linkage.lcims.base.memoryparam.ParamUtil");
		}
	}
	
	public static String getPaytypeName(int paytype) throws Exception{
		try{
			return paytypeMP.getDesc(paytype);
		}catch (Exception e) {
			throw new MPException(e, "com.linkage.lcims.base.memoryparam.ParamUtil");
		}
	}
	
	public static String getServiceTypeName(int serviceType) throws Exception{
		try{
			return serviceTypeMP.getName(serviceType);
		}catch (Exception e) {
			throw new MPException(e, "com.linkage.lcims.base.memoryparam.ParamUtil");
		}
	}

	public int getMONEY_CONVERSION() {
		return MONEY_CONVERSION;
	}
}
